FROM golang:1.24.1

WORKDIR /app

COPY ./go.mod .

# RUN apt-get update && apt-get install -y net-tools
# RUN ifconfig

# ENV HTTP_PROXY=http://172.17.0.1:7890
# ENV http_proxy=http://172.17.0.1:7890
# ENV https_proxy=http://172.17.0.1:7890
# ENV https_proxy=http://172.17.0.1:7890

RUN go env -w GOPROXY=https://goproxy.io,direct
RUN go install github.com/air-verse/air@latest
RUN go mod download
# RUN air init

# ENV HTTP_PROXY=
# ENV HTTPS_PROXY=
# ENV http_proxy=
# ENV https_proxy=


# 开发环境，使用 air 进行热重载启动
# CMD [ "air" ]

# RUN go build -o main
# CMD [ "/app/main" ]
